package structural.bridge;

/**
 * @Description: 桥接模式测试类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class BridgeTest {
    public static void main(String[] args) {

        AbstractRefill blueRefill = new BlueRefill();
        AbstractRefill redRefill = new RedRefill();
        AbstractRefill yellowRefill = new YellowRefill();
        AbstractRefill purpleRefill = new PurpleRefill();
        AbstractWrapper whiteWrapper = new WhiteWrapper();
        AbstractWrapper blackWrapper = new BlackWrapper();

        whiteWrapper.setRefill(blueRefill);
        whiteWrapper.write();
        whiteWrapper.setRefill(redRefill);
        whiteWrapper.write();
        whiteWrapper.setRefill(yellowRefill);
        whiteWrapper.write();
        whiteWrapper.setRefill(purpleRefill);
        whiteWrapper.write();

        blackWrapper.setRefill(blueRefill);
        blackWrapper.write();
        blackWrapper.setRefill(redRefill);
        blackWrapper.write();
        blackWrapper.setRefill(yellowRefill);
        blackWrapper.write();
        blackWrapper.setRefill(purpleRefill);
        blackWrapper.write();

    }
}
